package com.example.dataView.controller;


import com.example.dataView.common.result.R;
import com.example.dataView.service.MajorInfoService;
import io.swagger.annotations.*;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.constraints.NotBlank;

/**
 * @author 成大事
 * @since 2022-06-10 11:25:14
 */
@Api(tags = "专业信息")
@Slf4j
@Validated
@RestController
@RequestMapping("/majorInfo")
@RequiredArgsConstructor(onConstructor_ = @Autowired)
public class MajorInfoController {

    private final MajorInfoService majorInfoService;

    @ApiOperation(value = "根据学校id获取这个学校的专业信息")
    @PostMapping("/getMajorInfo")
    @ApiImplicitParams(value = {
            @ApiImplicitParam(name = "schoolId", value = "学校的id", dataTypeClass = String.class, paramType = "query")
    })
    @ApiResponses({
            @ApiResponse(code = 200,message = "成功"),
            @ApiResponse(code = 500,message = "错误"),
    })
    public R<Object> getMajorInfo(
            @RequestParam("schoolId") @NotBlank  String schoolId
    ){
        return majorInfoService.getMajorInfo(schoolId);
    }






}

